﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace GrupyzServices.BdAccess
{
    [MetadataType(typeof(OrderViewModel))]
    public partial class Order
    {
        public class OrderViewModel
        {
            [Required(ErrorMessage = " ")]
            [DisplayName("Primeiro Nome")]
            [StringLength(160)]
            public object PrimeiroNome { get; set; }

            [Required(ErrorMessage = " ")]
            [DisplayName("Ultimo Nome")]
            [StringLength(160)]
            public object UltimoNome { get; set; }

            [Required(ErrorMessage = " ")]
            [StringLength(250)]
            public object Morada { get; set; }

            [Required(ErrorMessage = " ")]
            [RegularExpression("\\d{4}(-\\d{3})?", ErrorMessage = "Código postal inválido")]
            [DisplayName("Código Postal")]
            [StringLength(8)]
            public object CodPostal { get; set; }

            [Required(ErrorMessage = " ")]
            [StringLength(40)]
            public object Localidade { get; set; }

            [RegularExpression("[0-9]{9}", ErrorMessage = " ")]
            public string Telefone { get; set; }

            [Required(ErrorMessage = " ")]
            [RegularExpression(@"^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$", ErrorMessage = " ")]
            public string Email { get; set; }

            [ScaffoldColumn(false)]
            public object Id { get; set; }

            [ScaffoldColumn(false)]
            public object Data { get; set; }

            [ScaffoldColumn(false)]
            public object IdCliente { get; set; }

            [ScaffoldColumn(false)]
            public object Total { get; set; }

        }
    }
}
